/*


 */

package jas.rpc;

import java.io.Serializable;

/**
 *
 *
 */
public class RpcRequest implements Serializable {
    public final Object objectToCall;
    public final String methodName;
    public final Object[] parameters;
    
    /**
     * Parameter types for the method to call. Provided to avoid ambigious calls to overloaded methods.
     */
    public final Class[] classes;
    
    public RpcRequest(Object objectToCall, String methodName, Object[] parameters, Class[] classes) {
        this.objectToCall = objectToCall;
        this.methodName = methodName;
        this.parameters = parameters;
        this.classes = classes;
    }
    
    @Override
    public String toString() {
        String s = "" + objectToCall + "." + methodName + "(";
        for (Object o : parameters) {
            s += o + ", ";
        }
        s += ")";
        return s;
    }
}
